package com.java.module.fire.service.impl;

import java.util.List;
import com.java.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.java.module.fire.mapper.ActivityMapper;
import com.java.module.fire.domain.Activity;
import com.java.module.fire.service.IActivityService;

/**
 * 活动内容Service业务层处理
 * 
 * @author Administrator
 * @date 2025-02-10
 */
@Service
public class ActivityServiceImpl implements IActivityService {
    @Autowired
    private ActivityMapper activityMapper;

    /**
     * 查询活动内容
     * 
     * @param activityId 活动内容ID
     * @return 活动内容
     */
    @Override
    public Activity selectActivityById(Long activityId) {
        return activityMapper.selectActivityById(activityId);
    }

    /**
     * 查询活动内容
     *
     * @param activity 活动内容
     * @return 活动内容
     */
    @Override
    public Activity selectActivityOne(Activity activity) {
        return activityMapper.selectActivityOne(activity);
    }

    /**
     * 查询活动内容列表
     * 
     * @param activity 活动内容
     * @return 活动内容
     */
    @Override
    public List<Activity> selectActivityList(Activity activity) {
        return activityMapper.selectActivityList(activity);
    }

    /**
     * 新增活动内容
     * 
     * @param activity 活动内容
     * @return 结果
     */
    @Override
    public int insertActivity(Activity activity) {
        activity.setCreateTime(DateUtils.getNowDate());
        return activityMapper.insertActivity(activity);
    }

    /**
     * 修改活动内容
     * 
     * @param activity 活动内容
     * @return 结果
     */
    @Override
    public int updateActivity(Activity activity) {
        activity.setUpdateTime(DateUtils.getNowDate());
        return activityMapper.updateActivity(activity);
    }

    /**
     * 批量删除活动内容
     * 
     * @param activityIds 需要删除的活动内容ID
     * @return 结果
     */
    @Override
    public int deleteActivityByIds(Long[] activityIds) {
        return activityMapper.deleteActivityByIds(activityIds);
    }

    /**
     * 删除活动内容信息
     * 
     * @param activityId 活动内容ID
     * @return 结果
     */
    @Override
    public int deleteActivityById(Long activityId) {
        return activityMapper.deleteActivityById(activityId);
    }
}
